home *** CD-ROM | disk | FTP | other *** search
/ 3D Images / 3D Images.iso / programs / amiga / batchfactory / scripts / imagefx / image-fx_images_to_jpeg < prev    next >
Encoding:
Text File  |  1995-01-12  |  2.0 KB  |  72 lines

  1. /* 
  2.                           IMAGE FX IMAGES TO JPEG
  3.                                By J.L. White
  4.                           ©1994 Merlin's Software
  5.  
  6.                          Convert Image To JPEG Image
  7.                               ImageFX Script
  8.  
  9.  Batch Factory Batch Conversion Scripts are basically Arexx scripts that
  10. allow you to pass certain parameters to the external program you wish
  11. to use to convert the images from one format to another. You can pass
  12. five different strings from Batch Factory to the script by using the
  13. following commands:
  14.  
  15. $N = This will pass the current selected filename.
  16. $P = This will tell Batch Factory to ask for a path to save new frames to.
  17. $# = This will pass the current frame number in the script.
  18. $T = This will pass the total number of frames in the script.
  19. $A = This will pass an offset number to be used to save frames with.
  20.  
  21. NOTE: The following line is required to work as a Batch Factory Script:
  22.  
  23. PARSE=$N $P $# $T $A
  24.  
  25. */
  26.  
  27. options results
  28. call Locate_ImageFX
  29.  
  30. address "IMAGEFX.1"
  31. arg InPic OutPic FrameNum TotalFiles AddNum
  32. SaveNum = FrameNum + AddNum
  33.  
  34. if FrameNum = 1 then do
  35.         ScreenToFront
  36.     RequestSlider '"Enter JPEG Compression Value!"' 1 100 85
  37.         if Result = "" then Result = 100
  38.         if Result = 0 then Result = 100
  39.     Format = JPEG
  40.     Quality = Result
  41.     call open TempFile,"Ram:IFITJ",W
  42.     call writeln TempFile,Format
  43.     call writeln TempFile,Quality
  44.     call close TempFile
  45.     end
  46. else do
  47.     call open TempFile,"Ram:IFITJ",R
  48.     line = readln(TempFile)
  49.     parse var line Format
  50.     line = readln(TempFile)
  51.     parse var line Quality
  52.     call close TempFile
  53.     end
  54. LoadBuffer InPic Force Smooth
  55. if OutPic = "SAME" then
  56.     SaveBufferAs Format InPic Quality
  57. else
  58.     SaveBufferAs Format OutPic""right(SaveNum,3,'0') Quality
  59. if FrameNum = TotalFiles then do
  60.     address command "delete >NIL: Ram:IFITJ"
  61.         end
  62. exit
  63.  
  64. Locate_ImageFX:
  65.     if (POS('IMAGEFX.1',SHOW('Ports')) = 0)
  66.     then do
  67.         address command 'run < nil: > nil: IMAGEFX:ImageFX'
  68.         address command 'wait 7'
  69.     end
  70. return
  71.  
  72.